import request from '@/utils/request'

// 查询列表
export function listApply(query) {
  return request({
    url: '/system/app/apply/page',
    method: 'get',
    params: query
  })
}

export function listWaitPayApply(query) {
  return request({
    url: '/system/app/apply/waitPay/page',
    method: 'get',
    params: query
  })
}

export function listPayFailApply(query) {
  return request({
    url: '/system/app/apply/payFail/page',
    method: 'get',
    params: query
  })
}

export function listPaySuccess(query) {
  return request({
    url: '/system/app/apply/paySuccess/page',
    method: 'get',
    params: query
  })
}

//拒绝订单列表
export function listFailApply(query) {
  return request({
    url: '/system/app/apply/fail/page',
    method: 'get',
    params: query
  })
}

//还款成功列表
export function listRepaySuccessApply(query) {
  return request({
    url: '/system/app/apply/repaySuccess/page',
    method: 'get',
    params: query
  })
}


export function listWaitWithdralApply(query) {
  return request({
    url: '/system/app/apply/waitWithdrawal/page',
    method: 'get',
    params: query
  })
}

//待还款订单
export function listWaitPaymentApply(query) {
  return request({
    url: '/system/app/apply/waiPayment/page',
    method: 'get',
    params: query
  })
}

export function listApplyNew(query) {
  return request({
    url: '/system/app/apply/search',
    method: 'get',
    params: query
  })
}

export function listOneExamineApply(query) {
  return request({
    url: '/system/app/apply/oneExamine/page',
    method: 'get',
    params: query
  })
}

export function listOneApply(query) {
  return request({
    url: '/system/app/apply/one/page',
    method: 'get',
    params: query
  })
}

export function listTwoApply(query) {
  return request({
    url: '/system/app/apply/two/page',
    method: 'get',
    params: query
  })
}

export function listTwoExamineApply(query) {
  return request({
    url: '/system/app/apply/twoExamine/page',
    method: 'get',
    params: query
  })
}

export function listOverApply(query) {
  return request({
    url: '/system/app/apply/over/page',
    method: 'get',
    params: query
  })
}

export function listUserInfoApply(query) {
  return request({
    url: '/system/app/apply/listUserInfoApply/page',
    method: 'get',
    params: query
  })
}


export function listApplyCompany(query) {
  return request({
    url: '/system/app/apply/listApplyCompany',
    method: 'get',
    params: query
  })
}


//获取初审人员列表
export function listExamineUser() {
  return request({
    url: '/system/app/apply/listExamineUser',
    method: 'get',
  })
}

export function listCollectionUser(query) {
  return request({
    url: '/system/app/apply/listCollectionUser',
    method: 'get',
    params: query
  })
}

export function payList(query) {
  return request({
    url: '/system/app/apply/payList',
    method: 'get',
    params: query
  })
}

export function paymentList(query) {
  return request({
    url: '/system/app/apply/paymentList',
    method: 'get',
    params: query
  })
}

export function applyLogList(query) {
  return request({
    url: '/system/app/apply/applyLogList',
    method: 'get',
    params: query
  })
}

export function getExamineLogList(query) {
  return request({
    url: '/system/app/apply/getExamineLogList',
    method: 'get',
    params: query
  })
}

export function overLogList(query) {
  return request({
    url: '/system/app/apply/overLogList',
    method: 'get',
    params: query
  })
}

export function updateApplyOneExamineBy(oneExamineBy, ids) {
  const data = {
    oneExamineBy,
    ids
  }
  return request({
    url: '/system/app/apply/updateApplyOneExamineBy',
    method: 'put',
    params: data
  })
}

export function updateApplyTwoExamineBy(twoExamineBy, ids) {
  const data = {
    twoExamineBy,
    ids
  }
  return request({
    url: '/system/app/apply/updateApplyTwoExamineBy',
    method: 'put',
    params: data
  })
}

export function updateApplyCollectionBy(collectionBy, ids) {
  const data = {
    collectionBy,
    ids
  }
  return request({
    url: '/system/app/apply/updateApplyCollectionBy',
    method: 'put',
    params: data
  })
}

export function updateApplyCutomerBy(customerBy, ids) {
  const data = {
    customerBy,
    ids
  }
  return request({
    url: '/system/app/apply/updateApplyCutomerBy',
    method: 'put',
    params: data
  })
}

export function examineApply(data) {
  return request({
    url: '/system/app/apply/examineApply',
    method: 'post',
    data: data
  })
}

export function applyInfo(data) {
  return request({
    url: '/system/app/apply/getInfo',
    method: 'get',
    params: data
  })
}


export function examineOneApply(data) {
  return request({
    url: '/system/app/apply/examineOneApply',
    method: 'put',
    params: data
  })
}

export function examineSuccessOneApply(data) {
  return request({
    url: '/system/app/apply/examineSuccessOneApply',
    method: 'put',
    params: {ids: data}
  })
}

export function examineTwoApply(data) {
  return request({
    url: '/system/app/apply/examineTwoApply',
    method: 'put',
    params: data
  })
}

export function handlePay(applyId, type, bankOrderNo) {
  const data = {
    applyId,
    type,
    bankOrderNo
  }
  return request({
    url: '/system/app/apply/payApply',
    method: 'put',
    params: data
  })
}

export function handlePayment(applyId, type, paymentMoney, status) {
  const data = {
    applyId,
    type,
    paymentMoney,
    status
  }
  return request({
    url: '/system/app/apply/paymentApply',
    method: 'put',
    params: data
  })
}

// 关闭订单
export function closeApply(ids) {
  return request({
    url: '/system/app/apply/close/' + ids,
    method: 'delete'
  })
}

//订单回收
export function recoveryApply(id) {
  return request({
    url: '/system/app/apply/recovery/' + id,
    method: 'put'
  })
}

export function addOverLogForm(data) {
  return request({
    url: '/system/app/apply/addOverLogForm',
    method: 'post',
    data: data
  })
}

export function getPaymentLogList(query) {
  return request({
    url: '/system/app/apply/getPaymentLogList',
    method: 'get',
    params: query
  })
}


export function revokeRepaymentLog(id) {
  return request({
    url: '/system/app/apply/revokeRepaymentLog/' + id,
    method: 'delete'
  })
}

export function listMyOverApply(query) {
  return request({
    url: '/system/app/apply/myOver/page',
    method: 'get',
    params: query
  })
}

export function listOverRepaymentApply(query) {
  return request({
    url: '/system/app/apply/overRepayment/page',
    method: 'get',
    params: query
  })
}

export function saveFollowUpRemarkById(data){
  return request({
    url:'/system/app/apply/saveFollowUpRemarkById',
    method: 'put',
    params: data
  })
}




